// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom/extend-expect';
import '@testing-library/jest-dom';
import { vi } from 'vitest';

// Mock matchmedia
window.matchMedia = window.matchMedia || function() {
  return {
      matches: false,
      addListener: function() {},
      removeListener: function() {}
  };
};

// Mock the electron global
window.electron = {
  executeCommand: vi.fn().mockImplementation((command: string) => {
    return Promise.resolve({
      output: `Mock output for command: ${command}`,
      exitCode: 0
    });
  }),
  getCurrentDirectory: vi.fn().mockImplementation(() => '/mock/directory'),
  selectDirectory: vi.fn().mockImplementation(() => Promise.resolve('/selected/directory'))
};
